<template>
    <el-sub-menu :index="menuitem.path">
        <template #title>
            <el-icon>  <component :is="'location'" /></el-icon>
            <span>{{menuitem.menuName}}</span>
        </template>
        <template v-for="(ele,index) in menuitem.children" :key="index">
            <el-menu-item :index="ele.path" v-if="!ele.children">
                <el-icon> <component :is="ele.icon" /> </el-icon>
                <template #title>{{ele.menuName}}</template>
            </el-menu-item>
            <submenu v-else :menuitem="ele" />
        </template>
    </el-sub-menu>
</template>
<script lang="ts">
    import {defineComponent, ref} from 'vue';

    export default defineComponent({
        name: 'submenu',
        props:{
            menuitem:Object
        },
        setup(props,ctx) {
            return {};
        },
    });
</script>
